﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="menuadd.aspx.cs" Inherits="UI.system.page.menu.menuadd" %>
<%@ Import Namespace="Model" %>
<%@ Import Namespace="Common" %>
<div style="margin: 15px;">
	<form class="layui-form" style="padding-left:0px;">
        <div class="layui-form-item">
			<label class="layui-form-label"><font>上级菜单</font><em>*</em></label>
			<div class="layui-input-block">
                <select id="parentid" name="parentid" lay-verify="required" lay-filter="parentid">
                    <option value="0" <%=0==info.ID?"selected":"" %>>无上级</option>
                    <%foreach (MenuInfo menu in parentlist){%>
					<option value="<%=menu.ID %>" <%=menu.ID==info.ParentID?"selected":"" %>><%=menu.Name%></option>
					<%} %>
				</select>
			</div>
	    </div>
        <div class="layui-form-item <%=info.Name=="菜单管理"?"hidden":"" %>">
			<label class="layui-form-label"><font>菜单名称</font><em>*</em></label>
			<div class="layui-input-block">
                <input type="text" name="name" placeholder="请输入菜单名称" lay-verify="required" class="layui-input" value="<%=info.Name %>">
			</div>
		</div>
        <div id="path" class="layui-form-item <%=info.ParentID==0 || info.Name=="菜单管理"?"hidden":"" %>">
			<label class="layui-form-label"><font>菜单路径</font></label>
			<div class="layui-input-block">
                <input type="text" name="path" placeholder="请输入菜单路径" class="layui-input" value="<%=info.Path %>">
			</div>
		</div>
        <div id="power" class="layui-form-item <%=info.ParentID==0 || info.Name=="菜单管理"?"hidden":"" %>">
			<label class="layui-form-label"><font>菜单权限</font></label>
			<div class="layui-input-block btns" style="padding-top:10px;">
                <%foreach (BtnsInfo btn in btnslist){%>
				<input type="checkbox" name="btns" lay-skin="primary" title="<%=btn.Name %>" value="<%=btn.ID %>" <%=info.Btns.Split(',').Contains(btn.ID.ToString())?"checked":"" %>>
                <%} %>
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label"><font>显示顺序</font><em>*</em></label>
			<div class="layui-input-block">
                <input type="text" name="sort" placeholder="请输入显示顺序" lay-verify="required" class="layui-input" value="<%=info.Sort %>">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label"><font>是否显示</font><em>*</em></label>
			<div class="layui-input-block">
                <input type="radio" name="isshow"  value="1" title="显示" <%=info.IsShow==1?"checked='checked'":"" %> />
                <input type="radio" name="isshow"  value="0" title="隐藏" <%=info.IsShow==0?"checked='checked'":"" %> />
			</div>
		</div>
		<a lay-filter="save" lay-submit style="display: none;"></a>
	</form>
</div>
<script>
    form.on('select(parentid)', function (data) {
        if (data.value == "0") {
            $("#path,#power").hide();
        } else {
            $("#path,#power").show();
        }
    });
</script>